package com.example.neusoft.yuejian_12.Service;

import com.example.neusoft.yuejian_12.JavaBean.Photo;
import com.example.neusoft.yuejian_12.JavaBean.User;
import com.example.neusoft.yuejian_12.JavaBean.UserCollect;
import com.example.neusoft.yuejian_12.JavaBean.UserOrder;
import com.example.neusoft.yuejian_12.JavaBean.UserOrderInfo;

import java.util.List;

import okhttp3.MultipartBody;
import okhttp3.ResponseBody;
import retrofit2.Call;
import retrofit2.http.GET;
import retrofit2.http.Multipart;
import retrofit2.http.POST;
import retrofit2.http.Part;
import retrofit2.http.Path;
import retrofit2.http.Query;

/**
 * Created by 晓真 on 2017/9/26.
 */

public interface UserService {
    //登录接口
    @GET("/workout/api.php/login")
    Call<User> Login(
            @Query("tel") String tel,
            @Query("password") String password
    );

    @GET("/workout/api.php/reg")
    Call<User> Register(
            @Query("user_name") String user_name,
            @Query("password") String password,
            @Query("tel") String tel
    );


    @GET("/workout/api.php/getmine/SessionID/{SessionID}/userid/{userid}")
    Call<User> getUserById(
            @Path("SessionID") String SessionID,
            @Path("userid") String userid
    );

    @GET("/workout/api.php/updatepass/SessionID/{SessionID}/userid/{userid}/password/{password}")
    Call<User> EditUserPass(
            @Path("SessionID") String SessionID,
            @Path("userid") String userid,
            @Path("password") String password
    );

    @GET("/workout/api.php/fuserphoto/SessionID/{SessionID}/userid/{userid}/user_name/{user_name}")
    Call<User> EditUserName(
            @Path("SessionID") String SessionID,
            @Path("userid") String userid,
            @Path("user_name") String user_name
    );

    @Multipart
    @POST("/workout/api.php/updatename/SessionID/lgj98rfkiqvenhrk2o7oe2po81/userid/{userid}")
    Call<ResponseBody> EditUserPhoto(
            @Path("userid") String userid,
            @Part MultipartBody.Part file
    );



    //用户关注列表
    @GET("/workout/api.php/lists/mod/{mod}/SessionID/{SessionID}/userid/{userid}")
    Call<List<UserCollect>> getcollect(
            @Path("mod") String mod,
            @Path("SessionID") String SessionID,
            @Path("userid") String userid
    );

    //取消关注俱乐部
    @GET("/workout/api.php/delete/mod/fans/user_id/{user_id}/fan_id/{fan_id}/fan_type/{fan_type}")
    Call<Integer> Nocollect(
            @Path("user_id") String user_id,
            @Path("fan_id") String fan_id,
            @Path("fan_type") String fan_type
    );

    //获取晒图列表
    @GET("/workout/api.php/lists/mod/{mod}/SessionID/{SessionID}/userid/{userid}")
    Call<List<Photo>> getShaituByUser(
            @Path("mod") String mod,
            @Path("SessionID") String SessionID,
            @Path("userid") String userid
    );

    //获取全部订单列表
    @GET("/workout/api.php/lists/mod/{mod}/listorder/update_time/userid/{userid}/SessionID/{SessionID}")
    Call<List<UserOrder>> getAllOrderByUser(
            @Path("mod") String mod,
            @Path("userid") String userid,
            @Path("SessionID") String SessionID
    );

    //获取已完成或者未参加订单
    @GET("/workout/api.php/lists/mod/{mod}/listorder/update_time/userid/{userid}/vstate/{vstate}/SessionID/{SessionID}")
    Call<List<UserOrder>> getOrderByType(
            @Path("mod") String mod,
            @Path("userid") String userid,
            @Path("vstate") String vstate,
            @Path("SessionID") String SessionID
    );

    //获取订单详情信息
    @GET("/workout/api.php/getDOrder/id/{id}/type/{type}/SessionID/{SessionID}")
    Call<UserOrderInfo> getSignById(
            @Path("id") String id,
            @Path("type") String type,
            @Path("SessionID") String SessionID
    );

    //获取订单申请退款
    @GET("/workout/api.php/refund/id/{id}/type/{type}/SessionID/{SessionID}")
    Call<UserOrderInfo> NoSign(
            @Path("id") String id,
            @Path("type") String type,
            @Path("SessionID") String SessionID
    );

    //个人中心：帮助与反馈
//    http://172.24.10.175/workout/api.php/create/mod/feedback/content/12312312312/contact/iamzjs@126.com/SessionID/pf2cmg5jk9p24f2mv1kjf55bo3
    @GET("/workout/api.php/create/mod/feedback/content/{content}/contact/{contact}/SessionID/{SessionID}")
    Call<Integer> UserHelp(
            @Path("content") String content,
            @Path("contact") String contact,
            @Path("SessionID") String SessionID

    );



}
